class Localcache {
  //将账号密码进行存储
  setcache(key: string, value: any) {
    window.localStorage.setItem(key, JSON.stringify(value))
  }
  //通过Key对账号密码进行获取
  getcache(key: string) {
    const value = window.localStorage.getItem(key)
    if (value) {
      return JSON.parse(value)
    }
  }
  //删除保存的账号密码
  deletecache(key: string) {
    window.localStorage.removeItem(key)
  }
  //清空保存的数据
  clearcache() {
    window.localStorage.clear()
  }
}

export default new Localcache()
